<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.jdbc.Jdbc"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="com.project.bean.*"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
	String sid= request.getParameter("sid");
	//首先获取显示页面用户的权限
	String find="select * from sales where id='"+sid+"'";
	Jdbc j = new Jdbc();
	ResultSet rs;

	j.Jdbc_Q2(find);
	rs = j.rs;
	rs.next();
		Sales sa = new Sales();
		sa.setId(rs.getString("id"));
		sa.setChinesename(rs.getString("chinesename"));
		sa.setEnglishname(rs.getString("englishname"));
		sa.setSex(rs.getString("sex"));
		sa.setBirthday(rs.getString("birthday"));
		sa.setReservation(rs.getString("reservation"));
		sa.setAttend(rs.getString("attend"));
		sa.setMessagefrom(rs.getString("messagefrom"));
		sa.setMarketman(rs.getString("marketman"));
		sa.setCounselor(rs.getString("counselor"));
		sa.setPhonecounselor(rs.getString("phonecounselor"));
		sa.setDistributionstate(rs.getString("distributionstate"));
		sa.setDistributiontime(rs.getString("distributiontime"));
		sa.setPhone1(rs.getString("phone1"));
		sa.setPhone2(rs.getString("phone2"));
		sa.setRemarks(rs.getString("remarks"));
		sa.setUsername(rs.getString("username"));
		
	
%>
<head>
<meta charset="utf-8">
<title>用户管理-添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>

<body>
	<div class="x-body">
		<form class="layui-form" action="updatesales" method="post">

			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>学生编号
				</label>
				<div class="layui-input-inline">
					 <input type="text"  name="id" id="id"  required lay-verify="pass"
                         class="layui-input" value="<%=sa.getId()%>" readonly> 
					
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>中文名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="chinesename" required lay-verify="pass"
						class="layui-input" value="<%=sa.getChinesename()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>英文名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="englishname" required lay-verify="pass"
						class="layui-input" value="<%=sa.getEnglishname()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>性别
				</label>
				<div class="layui-input-inline">

					<select class="layui-input" name="sex" id="sex" required><option selected="selected"><%=sa.getSex() %></option>
						<option value="男">男</option>
						<option value="女">女</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>生日
				</label>
				<div class="layui-input-inline">
					<input type="date" name="birthday" required lay-verify="pass"
						class="layui-input" value="<%=sa.getBirthday()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>


			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>信息来源
				</label>
				<div class="layui-input-inline">
					<input type="text" name="messagefrom" required lay-verify="pass"
						class="layui-input" value="<%=sa.getMessagefrom()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>市场推广员
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="marketman"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="marketman"><option
							selected="selected" required><%=sa.getMarketman()%> </option>
						<option value="A">A</option>
						<option value="B">B</option>
						<option value="C">C</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>



			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>顾问
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="counselor"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="counselor"><option
							selected="selected" required><%=sa.getCounselor() %></option>
						<option value="无">无</option>
						<option value="Maggie王楚蕊">Maggie王楚蕊</option>
						<option value="Wing">Wing</option>
						<option value="Amy陈丹丹">Amy陈丹丹</option>
						<option value="Danny王栋">Danny王栋</option>
						<option value="Tang汤奎秀">Tang汤奎秀</option>
						<option value="狄永霞">狄永霞</option>
						<option value="Grace金">Grace金</option>
						<option value="Julia魏">Julia魏</option>
						<option value="Tina胡婷">Tina胡婷</option>

					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>电话顾问
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="phonecounselor"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="phonecounselor"><option
							selected="selected" required><%=sa.getPhonecounselor() %></option>
							<option value="无">无</option>
						<option value="Tina胡婷">Tina胡婷</option>
						<option value="Danny王栋">Danny王栋</option>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>分配状态
				</label>
				<div class="layui-input-inline">

					<select class="layui-input" name="distributionstate"><option
							selected="selected" required><%=sa.getDistributionstate() %></option>
						<option value="已分配">已分配</option>
						<option value="未分配">未分配</option>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>分配时间
				</label>
				<div class="layui-input-inline">
					<input type="date" name="distributiontime" required
						lay-verify="pass" class="layui-input" value="<%=sa.getDistributiontime()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>联系电话1
				</label>
				<div class="layui-input-inline">
					<input type="text" name="phone1" 
						lay-verify="text" class="layui-input" value="<%=sa.getPhone1()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>联系电话2
				</label>
				<div class="layui-input-inline">
					<input type="text" name="phone2" 
						lay-verify="text" class="layui-input" value="<%=sa.getPhone2()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>备注
				</label>
				<div class="layui-input-inline">
					<input type="text" name="remarks" 
						lay-verify="text" class="layui-input" value="<%=sa.getRemarks()%>">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>
				</div>
			</div>




			<div class="layui-form-item">
				<label for="L_repass" class="layui-form-label"> </label>
				<button class="layui-btn" lay-filter="add" lay-submit="">
					修改</button>
			</div>
		</form>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8">
		
	</script>
	<script src="./js/x-layui.js" charset="utf-8">
		
	</script>
	<!--         <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //自定义验证规则
              form.verify({
                nikename: function(value){
                  if(value.length < 5){
                    return '昵称至少得5个字符啊';
                  }
                }
                ,pass: [/(.+){6,12}$/, '密码必须6到12位']
                ,repass: function(value){
                    if($('#L_pass').val()!=$('#L_repass').val()){
                        return '两次密码不一致';
                    }
                }
              });

              //监听提交
              form.on('submit(add)', function(data){
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("增加成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });
                return false;
              });
              
              
            }); -->
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
	</script>
</body>

</html>